package com.py.androidUtils.UI;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.py.androidUtils.UI.adapter.MyFragmentPagerAdapter;
import com.py.androidUtils.base.BaseActivity;
import com.readyidu.app.R;

/**
 * @说明
 * @作者 LY
 * @文件 CheckImagesActivity.java
 * @时间 2015年7月28日 上午11:00:32
 */
public class CheckImagesActivity extends BaseActivity {
	private ViewPager page;
	private ArrayList<Fragment> fragmentsList;

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.activity_check_images);
		page = (ViewPager) this.findViewById(R.id.page);
		fragmentsList = new ArrayList<Fragment>();
		List<String> list = getIntent().getExtras().getStringArrayList("images");
		for (int i = 0; i < list.size(); i++) {
			fragmentsList.add(ImagesFragment.newInstance(list.get(i)));
		}
		page.setOffscreenPageLimit(fragmentsList.size());
		page.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager(), fragmentsList));
		page.setCurrentItem(0);
	}

}
